package 数学类;

import java.util.Scanner;

public class 判断一个数是否为质数 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.print("请输入要判断的数字:");
        int num=sc.nextInt();
        System.out.println( isShusu(num));
    }
    private static boolean isShusu(int a) {
        for (int i = 2; i < Math.sqrt(a); i++) {
            if(a%i==0){
                return false;
            }
        }
        return true;
    }
}
